import request from '/@/utils/request';

// ----- 内容专题 -----
// 列表
export const fetchSubjectList = (params?: object) => {
	return request({
		url: '/content/special',
		method: 'get',
		params,
	});
};
// 新增消费场景
export const fetchCreateSubject = (data: any) => {
	return request({
		url: '/content/special/create',
		method: 'post',
		data,
	});
};

// 编辑
export const fetchUpdateSubject = (data: any) => {
	return request({
		url: '/content/special/update',
		method: 'post',
		data,
	});
};

// 状态
export const fetchSwitchSubject = (data: any) => {
	return request({
		url: 'content/special/switch',
		method: 'post',
		data,
	});
};

// 删除
export const fetchDelSubject = (data: any) => {
	return request({
		url: '/content/special/delete',
		method: 'post',
		data,
	});
};

// 预览
export const fetchQrCode = (data: any) => {
	return request({
		url: '/content/qrCode',
		method: 'post',
		data,
	});
};

// ----- 防伪图鉴 -----
// 列表
export const fetchAntiFakeList = (params?: object) => {
	return request({
		url: '/content/antiFake',
		method: 'get',
		params,
	});
};
// 新增
export const fetchCreateAntiFake = (data: any) => {
	return request({
		url: '/content/antiFake/create',
		method: 'post',
		data,
	});
};

// 详情
export const fetchAntiFakeDetail = (params?: object) => {
	return request({
		url: '/content/antiFake/detail',
		method: 'get',
		params,
	});
};

// 编辑
export const fetchUpdateAntiFake = (data: any) => {
	return request({
		url: '/content/antiFake/update',
		method: 'post',
		data,
	});
};

// 删除
export const fetchDelAntiFake = (data: any) => {
	return request({
		url: '/content/antiFake/delete',
		method: 'post',
		data,
	});
};

// ----- 内容创作 -----
export const fetchCreatioStatics = (params?: object) => {
	return request({
		url: '/content/count',
		method: 'get',
		params,
	});
};
// 列表
export const fetchCreationList = (params?: object) => {
	return request({
		url: '/content',
		method: 'get',
		params,
	});
};

// 新增
export const fetchCreateCreation = (data: any) => {
	return request({
		url: '/content/create',
		method: 'post',
		data,
	});
};
// 发布
export const fetchPublishCreation = (data: any) => {
	return request({
		url: '/content/publish',
		method: 'post',
		data,
	});
};

// 详情
export const fetchCreationDetail = (params?: object) => {
	return request({
		url: '/content/detail',
		method: 'get',
		params,
	});
};

// 编辑
export const fetchUpdateCreation = (data: any) => {
	return request({
		url: '/content/update',
		method: 'post',
		data,
	});
};

// 删除
export const fetchDelCreation = (data: any) => {
	return request({
		url: '/content/delete',
		method: 'post',
		data,
	});
};

// 审核
export const fetchAuditCreation = (data: any) => {
	return request({
		url: '/content/check',
		method: 'post',
		data,
	});
};

//---- 内容分类 -----
// 列表
export const fetchTypeList = (params?: object) => {
	return request({
		url: '/content/type',
		method: 'get',
		params,
	});
};
// 新增
export const fetchCreateType = (data: any) => {
	return request({
		url: '/content/type/create',
		method: 'post',
		data,
	});
};

// 编辑
export const fetchUpdateType = (data: any) => {
	return request({
		url: '/content/type/update',
		method: 'post',
		data,
	});
};

// 删除
export const fetchDelType = (data: any) => {
	return request({
		url: '/content/type/delete',
		method: 'post',
		data,
	});
};
